<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>新增</title>
<link rel="stylesheet" type="text/css"
	href="/ExamOnline/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="/ExamOnline/easyui/themes/icon.css">
<script type="text/javascript" src="/ExamOnline/easyui/jquery.min.js"></script>
<script type="text/javascript"
	src="/ExamOnline/easyui/jquery.easyui.min.js"></script>
</head>
<body>
	<div class="easyui-panel" title="新增学员" style="width:400px">
		<div style="padding:10px 60px 20px 60px">
			<form id="ff" method="post">
				<table cellpadding="5">
					<tr>
						<td>学员名称:</td>
						<td><input class="easyui-textbox" type="text" name="name"
							data-options="required:true"></input></td>
					</tr>
					<tr>
						<td>密码:</td>
						<td><input class="easyui-textbox" name="pwd" type="password"
							data-options="required:true"></input></td>
					</tr>
					<tr>
						<td>阶段:</td>
						<td><select name="stage" class="easyui-combobox"
							panelHeight="auto">
								<option value="1">一阶段</option>
								<option value="2">二阶段</option>
								<option value="3">三阶段</option>
								<option value="4">四阶段</option>
						</select></td>
					</tr>
					<tr>
						<td>状态:</td>
						<td><select name="status" class="easyui-combobox"
							panelHeight="auto">
								<option value="1">正常</option>
								<option value="2">重修</option>
						</select></td>
					</tr>
					<tr>
						<td>入学时间:</td>
						<td><input id="dd" name="entrancetime" type="text"
							class="easyui-datebox" required="required"></td>
					</tr>
					<tr>
						<td colspan="2">
							<div style="text-align:center;padding:5px">
								<a href="javascript:void(0)" class="easyui-linkbutton"
									onclick="submitForm()">新增</a>
							</div>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
	<script>
		function submitForm() {
			$.post("/ExamOnline/user/add", $('#ff').serialize(), function(r) {
				$.messager.alert('提示消息', r);
			});
		}
		
		//得到当前日期
		formatterDate = function(date) {
			var day = date.getDate() > 9 ? date.getDate() : "0" + date.getDate();
			var month = (date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : "0"+ (date.getMonth() + 1);
			return date.getFullYear() + '-' + month + '-' + day;
		}
		window.onload=function(){
			$('#dd').datebox('setValue',formatterDate(new Date()));
		}
		
	</script>
</body>
</html>
